<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>click 事件</title>
	<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript">
		$(function(){

			$('#btn').click(function(){

				$('.box').toggleClass('sty');
			});

		})
	</script>
	<style type="text/css">
		.box{
			width:200px;
			height:200px;
			background-color:gold;
		}

		.sty{
			background-color:green;
		}


	</style>
</head>
<body>
	<input type="button" name="" value="切换" id="btn">
	<div class="box"></div>
</body>
</html>